import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:search_people/entrance/route/routes.dart';
import 'package:search_people/utils/component/component.dart';
import 'package:search_people/utils/component/selection/index.dart';

import 'index.dart';
import 'widgets/widgets.dart';

class SuperSearchPage extends GetView<SuperSearchController> {
  const SuperSearchPage({Key? key}) : super(key: key);

  // 主视图
  Widget _buildView() {
    var state = controller.state;
    return state.isShowCondition
        ? SelectionPage(
            list: state.list,
            onSelected: controller.actionSure,
          )
        : SuperSearchResultWidget();
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<SuperSearchController>(
      builder: (_) {
        return Scaffold(
          appBar: detailAppBar(context, title: '高级搜索'),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
